<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f() {
            var ele = document.getElementById('num1');
            var elem = document.getElementById('num2');
            var elemw = document.getElementById('num3');
            elemw.value=parseInt(ele.value)+parseInt(elem.value)
        }
    </script>
</head>
<body>
<input type="text" id="num1" value="">+
<input type="text" id="num2" value="">
<input onclick="f()" type="button" value="=">
<input type="text" id="num3" value="">

</body>
</html>